function accuracy = LDF_Classifier_test(data_fold_path, omega,omega0,P);
%test the classifier
%omega,omega0:Gauss distribution para
%P:PCA para, reduce the dim
%accuracy: test result
accuracy=0;
%check the input
if ~ischar(data_fold_path)
    error('input args should be char array like ''../data/'' ');
    return;
end

%read data
test_image_name='t10k-images.idx3-ubyte';
test_label_name='t10k-labels.idx1-ubyte';

test_image_full_path=strcat(data_fold_path,test_image_name);
test_label_full_path=strcat(data_fold_path,test_label_name);

images=loadMNISTImages(test_image_full_path);
labels=loadMNISTLabels(test_label_full_path);

%reduce the dim
images_k=P.'*images;

test_data_size=size(images_k,2);
g=omega.'*images_k+repmat(omega0.',1,test_data_size);

[g_max,g_max_index]=max(g);

labels_result=g_max_index.';

labels_result = labels_result-(labels+1);

error_num=find(labels_result);

accuracy=1-size(error_num,1)/test_data_size;

end